from  socket import *
tcp_socket = socket()
ADDR = ("127.0.0.1",8888)
tcp_socket.connect(ADDR)


#收发数据
while True:
    msg = input(">>")
    tcp_socket.send(msg.encode())
    if msg =="##":
        break
    data = tcp_socket.recv(1024)
    print("from server:",data.decode())


tcp_socket.close()
